import { createRouter, createWebHashHistory,createWebHistory } from 'vue-router'
import Home from '../views/Home.vue'

const routes = [
  {
    path: '/',
    name: 'Cover',
    component: () => import(/* webpackChunkName: "about" */ '../views/Cover.vue')
  },
  {
    path:'/MyPage',
    name:'MyPage',
    component:()=>import('../views/MyPage.vue'),
    meta:{
      keepAlive:true
    }
  },
  {
    path: '/about',
    name: 'About',

    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/login',
    name: 'Login',

    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: '/register',
    name: 'Register',

    component: () => import(/* webpackChunkName: "about" */ '../views/Register.vue')
  },
  {
    path: '/advancedSearch',
    name: 'AdvancedSearch',
    component: () => import(/* webpackChunkName: "about" */ '../views/AdvancedSearch'),
    meta: {
      keepAlive: true
    }
  },
  {
    path: '/searchResult',
    name: 'SearchResult',
    meta: {
      keepAlive: true
    },
    component: () => import(/* webpackChunkName: "about" */ '../views/SearchResult')
  },
  {
    path: '/profile',
    name: 'Profile',

    component: () => import(/* webpackChunkName: "about" */ '../views/Profile'),
    meta: {
      keepAlive: true
    }
  },
  {
    path: '/messageList',
    name: 'MessageList',

    component: () => import(/* webpackChunkName: "about" */ '../views/MessageList')
  },
  {
    path: '/manager',
    name: 'Manager',

    component: () => import(/* webpackChunkName: "about" */ '../views/manager'),

    meta: {
      keepAlive: true
    }
  },
  {
    path: '/managerfor',
    name: 'Managerfor',

    component: () => import(/* webpackChunkName: "about" */ '../views/manager/index'),

    meta: {
      keepAlive: true
    }
  },
  {
    path: '/personalMessage',
    name: 'PersonalMessage',

    component: () => import(/* webpackChunkName: "about" */ '../views/PersonalMessage'),
  },
  {
    path: '/info',
    name: 'Info',

    component: () => import(/* webpackChunkName: "about" */ '../views/Info')
  },
  {
    path: '/paperDetail',
    name: 'PaperDetail',
    component: () => import(/* webpackChunkName: "about" */ '../views/PaperDetail'),
    meta: {
      keepAlive: true
    }

  },
  {
    path: '/category',
    name: 'Category',

    component: () => import(/* webpackChunkName: "about" */ '../views/Category')
  },
  {
    path: '/chart',
    name: 'Chart',
    component: () => import(/* webpackChunkName: "about" */ '../views/chart'),
    meta: {
      keepAlive: true
    }
  },
  {
    path: '/journalList',
    name: 'JournalList',

    component: () => import(/* webpackChunkName: "about" */ '../views/JournalList')
  },
  {
    path: '/help',
    name: 'Help',

    component: () => import(/* webpackChunkName: "about" */ '../views/Help')
  },
  {
    path: '/institute',
    name: 'Institute',
    component: () => import(/* webpackChunkName: "about" */ '../views/Institute')
  },
  {
    path: '/appeal',
    name: 'Appeal',
    component: () => import(/* webpackChunkName: "about" */ '../views/Appeal')
  },
  {
    path: '/certificate',
    name: 'Certificate',
    component: () => import(/* webpackChunkName: "about" */ '../views/Certificate')
  },
  {
    path: '/history',
    name: 'History',
    component: () => import(/* webpackChunkName: "about" */ '../views/History')
  },
  {
    path: '/report',
    name: 'Report',
    component: () => import(/* webpackChunkName: "about" */ '../views/report.vue'),
  },
  {
    path: '/beta',
    name: 'Beta',
    component: () => import(/* webpackChunkName: "about" */ '../views/beta'),
  },
  {
    path: '/404',
    name: '404',
    component: () => import(/* webpackChunkName: "about" */ '../views/404'),
    meta: {
      keepAlive: true
    }
  },
  //  注意这个一定要放在最后
  {
    path: '/:pathMatch(.*)', redirect: '/404'
  }
]

const router = createRouter({
  // history: createWebHashHistory(process.env.BASE_URL),
  history: createWebHistory(process.env.BASE_URL),
  routes

})

export default router
